<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%--
代码为自动生成 Created by www.magicalcoder.com
 如果你改变了此类 read 请将此行删除
 欢迎加入官方QQ群:323237052
--%>
<html>
<head>
    <%@include file="../../common/head.jsp"%>
    <title>学校编辑</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <%@include file="../include/head.jsp"%>
</head>
<body class="skin-blue">
    <header class="header">
        <%@include file="../include/top.jsp"%>
    </header>
    <div class="wrapper row-offcanvas row-offcanvas-left">
        <aside class="left-side sidebar-offcanvas">
            <%@include file="../include/left.jsp"%>
        </aside>
        <aside class="right-side">
            <section class="content-header">
                <h1>
                    学校详情
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="admin/index"><i class="fa fa-dashboard"></i> 主页</a></li>
                    <li><a href="admin/school/list">学校列表</a></li>
                    <li class="active">学校详情</li>
                </ol>
            </section>
            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-primary">
                            <form class="form-horizontal" role="form" id="form" action="admin/school/save" method="post">
                                <div class="box-header">
                                    <h3 class="box-title">
                                        <c:choose><c:when test="${school.id==null}">新增</c:when><c:otherwise>编辑</c:otherwise></c:choose>
                                    </h3>
                                    <h3 class="box-title alert-danger">${exceptionMsg}</h3>
                                </div>
                                <input type="hidden" name="id" value="${school.id}">
                                <input type="hidden" id="queryParamCacheKey" name="queryParamCacheKey" value="${queryParamCacheKey}">

                                <div class="box-body">

                                    <%--schoolName 学校名称 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">学校名称</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control "  name="schoolName" title="学校名称"   required  chineseCharacter  minLength="0"  value="${school.schoolName}" style="min-width: 100px;"  placeholder="请输入学校名称">
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--headImg 学校头像 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">学校头像</label>
                                        <div class="col-sm-9">
                                            <img style="max-width: 171px" src="${school.headImg}" />
                                            <input type="text" class="form-control " name="headImg" value="${school.headImg}" placeholder="请输入学校头像">
                                            <input type="file" name="myfiles" onchange="uploadFile2('headImg','school',this)" class="file" />
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--classCount 班级个数 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">班级个数</label>
                                        <div class="col-sm-9">
                                            <input type="text" class="form-control "  name="classCount" title="班级个数"   digits  minLength="0"  value="${school.classCount}" style="min-width: 100px;"  placeholder="请输入班级个数">
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--adress 学校地址 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">学校地址</label>
                                        <div class="col-sm-9">
                                            <textarea name="adress" title="学校地址" style="min-width: 100px;" cols="100" rows="8" class="form-control "  placeholder="请输入学校地址" >${school.adress}</textarea>
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--schoolType 学校类型 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">学校类型</label>
                                         <div class="col-sm-9" style="min-width:120px">
                                            <select style="min-width: 100px;" class="form-control" name="schoolType" title="学校类型"  >
                                                <option <c:if test="${ school.schoolType == 0 }">selected</c:if> value="0" >普通</option>
                                                <option <c:if test="${ school.schoolType == 1 }">selected</c:if> value="1" >重点</option>
                                            </select>
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--open 是否开学 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">是否开学</label>
                                        <div class="col-sm-9">
                                            <input type="radio" class="form-control " name="open" title="是否开学"    <c:if test="${school.open!=null and !school.open }">checked</c:if>  value="false" >否
                                            <input type="radio" class="form-control " name="open" title="是否开学"    <c:if test="${ school.open==null or school.open }">checked</c:if>  value="true" >是
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--createTime 创建时间 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">创建时间</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="createTime" class="Wdate form-control"  onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<fmt:formatDate value="${ school.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/>" style="min-width: 170px;">
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--schoolDesc 学校描述 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">学校描述</label>
                                        <div class="col-sm-9">
                                            <textarea name="schoolDesc" title="学校描述" cols="100" rows="20"  class="form-control " id="schoolDesc" style="width:1038px;height:600px;visibility:hidden;"   placeholder="请输入学校描述" >${school.schoolDesc}</textarea>
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <%--updateTime 更新时间 --%>
                                    <div class="form-group ">
                                        <label class="col-sm-1 control-label">更新时间</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="updateTime" class="Wdate form-control"  onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<fmt:formatDate value="${ school.updateTime }" pattern="yyyy-MM-dd HH:mm:ss"/>" style="min-width: 170px;">
                                        </div>
                                        <label class="col-sm-2 control-label" ><span class="validateMsg"></span></label>
                                    </div>

                                    <div class="form-group <c:if test="${ logAdminOperateId==null }">hidden</c:if> " id="historyOperateRecords">
                                        <label class="col-sm-1 control-label">历史记录</label>
                                        <div class="col-sm-9" style="min-width:120px">
                                            <select class="form-control" onchange="historySelectChange(this)">
                                                <option value="">请选择</option>
                                                <c:forEach var="log" items="${logAdminOperateList}">
                                                    <option <c:if test="${ log.id==logAdminOperateId }">selected</c:if> value="${log.id}"><fmt:formatDate value="${ log.createTime }" pattern="yyyy-MM-dd HH:mm:ss" />-${ log.userName }</option>
                                                </c:forEach>
                                            </select>
                                        </div>
                                    </div>
                                </div><!-- /.box-body -->
                                <div class="box-footer">
                                    <c:if test="${ adminPriority!=null and ((adminPriority.canInsert and school.id==null) or (adminPriority.canUpdate and school.id!=null))}">
                                        <button type="button" onclick="submitForm('#form')" class="btn btn-danger">保存</button>
                                    </c:if>
                                        <button type="button" onclick="returnToListPage('school','${queryParamCacheKey}','${school.id}')"  class="btn btn-primary">返回</button>
                                    <button type="button" onclick="historySelectShow()"  class="btn btn-primary">显示历史记录</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </section>
        </aside>
    </div>
    <%@include file="../include/tail.jsp"%>

    <script>
        $(function(){
            createKindEditor("schoolDesc");
        })
    </script>
    <script type="text/javascript" >
        $(function(){
            //base.js
            validateForm("#form")
            initSingleSelect2Ajax($("#form"))
            autoSetSingleSelect2Value($("#form"))
        })
    </script>
</body>
</html>
